package com.dy.dynotinstalled.room;

import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;
import androidx.room.Update;

import java.util.List;

/**
 * @author Li Xuyang
 * @date : 2019/9/26 19:11
 */
@Dao
public interface NotDoorInformationDao {

    //插入
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void insertDoorInformation(NotDoorInformation... notDoorInformation);

    //更新

    @Update
    void updateDoorInformation(NotDoorInformation... notDoorInformation);

    @Delete
    void deleteDoorInformation(NotDoorInformation... notDoorInformation);

    //删除全部
    @Query("DELETE FROM NotDoorInformation")
    void deleteAllDoorInformation();

    @Query("SELECT * FROM NotDoorInformation ORDER BY ID DESC")
        //List<Word> getAllWords();
    LiveData<List<NotDoorInformation>> getAllDoorInformationLive();



}
